﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="borrowerPage.aspx.cs" Inherits="LibrarySystem.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
    <div id="borrowerAdmin">
    <asp:Label ID="borrowerName" runat="server"></asp:Label>
    <br /><br /></div>

    <div id="brwrActive">
    <asp:Label ID="Label1" runat="server">Aktiva lån:</asp:Label>
    <asp:ListView ID="adminBorrowerActiveLoans" runat="server">
        <LayoutTemplate> 
             <tbody> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </tbody>
        </LayoutTemplate>
        <ItemTemplate>    
            <asp:LinkButton ID="LinkButton1"  runat="server" OnCommand="listItem_ClickedBook" CssClass="linkBtnBook" CommandName='<%#Eval("ISBN")%>'>        
                <table id="actTable"> <tr><td id="brwrTitle"><%# Eval("Title") %> </td><td id="brwrBarcode">Barcode: <%# Eval("Barcode") %></td></tr>
                    <tr><td id="brwrSD">Lånad: <%# Eval("StartDate") %></td><td id="brwrED">Lämnas senast: <%# Eval("EndDate") %></td></tr>
                    <tr><td><asp:Button ID="extendLoanBtn" CssClass="forlangBtn" runat="server" Text="Förläng" OnCommand="extendLoanBtn_Click" CommandName="<%#Eval("Barcode")%>"/></td></tr>
                        
                    
                </table>
                </asp:LinkButton>
        </ItemTemplate>        
    </asp:ListView>
        </div>


    <div id="brwrHistory">
    <br /><asp:Label ID="Label2" runat="server">Historik:</asp:Label>
    <asp:ListView ID="adminBorrowerHistory" runat="server">
        <LayoutTemplate> 
             <tbody> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </tbody>
        </LayoutTemplate>
        <ItemTemplate>    
            <asp:LinkButton ID="LinkButton1"  runat="server" OnCommand="listItem_ClickedBook" CssClass="linkBtnBook" CommandName='<%#Eval("ISBN")%>'>        
                <table id="histTable"> <tr id="histRow1"><td id="brwrTitle"><%# Eval("Title") %> </td><td id="brwrBarcode">Barcode: <%# Eval("Barcode") %></td></tr>
                    <tr id="histRow2"><td id="brwrSD">Lånad: <%# Eval("StartDate") %></td><td id="brwrRD">Återlämnad: <%# Eval("ReturnDate") %></td><td id="brwrED">Lämnas senast: <%# Eval("EndDate") %></td></tr>
                </table>
                </asp:LinkButton>
        </ItemTemplate>        
    </asp:ListView>
        </div>
</asp:Content>
